﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;

namespace HTComics.Web.Common
{
    public class PriceBandCollection : CollectionBase
    {
        public PriceBandCollection()
        {
        }

        public void Add(PriceBand priceBand)
        {
            this.InnerList.Add(priceBand);
        }

        public PriceBand this[double value]
        {
            get
            {
                PriceBand band = null;
                for (int i = 0; i <= this.InnerList.Count - 1; i++)
                {
                    if (value >= ((PriceBand)this.InnerList[i]).RangeStart && value <= ((PriceBand)this.InnerList[i]).RangeEnd)
                    {
                        band = (PriceBand)this.InnerList[i];
                        break;
                    }
                }
                return band;
            }
        }
    }

    public class PriceBand
    {
        public int BandId { get; set; }
        public double RangeStart { get; set; }
        public double RangeEnd { get; set; }
    }
}